export async function getVideo() {
    const stream = await navigator.mediaDevices
        .getUserMedia({ audio: true, video: true });
    console.log(stream);
    const devices = await navigator.mediaDevices.enumerateDevices();
    console.log(devices);

    var video = document.querySelector("video");
    video.srcObject = stream;
    video.onloadedmetadata = function (e) {
        video.play();
    };

    //
    const audioTracks = stream.getAudioTracks();
    const videoTracks = stream.getVideoTracks();
    console.log(audioTracks, videoTracks);
}
